<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        img {
            vertical-align: middle;
        }
        div {
            float: left;
            position: relative;
        }
        div:hover::before {
            /* 因为伪元素 添加的位置在父亲前后 所以定位创建的元素 */
            content: '';
            position: absolute;
            width: 100%;
            height: 100%;
            border: 10px solid rgba(255, 255, 255, .3);
            box-sizing: border-box;
        }
    </style>
</head>
<body>
    <div>
        <img src="images/mi.jpg" alt="">
    </div>
    
</body>
</html>